<?php
namespace app\admin\model;

use think\Exception;
use think\Model;
//用户页
class Users extends Model{
    //用户列表
     public static function   usersList(){
         $user=Users::paginate(5);
         return $user;
     }
     //用户添加
         public static function   usersAddInfo($data){
            try{
                $res=Users::strict(true)->insert($data);
            }catch (Exception $e){
                $res=false;
            }
            return $res;
     }
     //用户修改
     public static function   userEditInfo($get){
         $find=Users::find($get['id'])->toArray();

         return $find;
         }
      public static function   userEdit($data,$post){
          try{
              $res=Users::where('id','=',$post['uid'])->update($data);
          }catch (Exception $e){
              $res=false;
          }
         return $res;
          }

}